<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: kane <chengjin005@163.com> 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\wsapi\controller;

use cmf\controller\HomeBaseController;
use app\admin\model\CaseModel;
use think\Db;

/**
 * Class 
 * @package app\admin\controller
 */
class WsapiController extends HomeBaseController
{

	/**
	 * 幻灯片接口
	 */
	public function slideList()
	{
		$data = Db::name('slideItem')->where(['status'=>1])->select()->toArray();
		foreach($data as $k=>$v)
		{
			$data[$k]['image'] = config('server_url').$v['image'];
		}
		ajaxReturn(['data'=>$data]);
	}

	/**
	 * 案例接口
	 */
	public function caseList()
	{
		$data = Db::name('case')->select()->toArray();
		foreach($data as $k=>$v)
		{
			$data[$k]['case_img_url'] = config('server_url').$v['case_img_url'];
		}
		ajaxReturn(['data'=>$data]);
	}

	/**
	 * 案列详情接口
	 */
	public function detail()
	{
		$id = $this->request->param('id');
		$result = Db::name('case')->where(['id'=>$id])->find();
		ajaxReturn(['data'=>$result]);
	}
}